<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<title>订单处理</title>
		<%@include file="../common/common.jsp" %>
		<link rel="stylesheet" href="${ctx}/css/body.css" />
	</head>

	<body>
		<header>
			<nav class="headerTwo clearfix">
				<img src="${ctx }/image/bg.png" alt="" />
				<a href="javascript:history.back(-1)" class="fl"><img src="${ctx }/image/return.png" alt="" /></a>
				<h2>订单结算</h2>
			</nav>
		</header>
		<section class="orderAddress">
			<img src="${ctx }/image/xinfeng.png" alt="" />
			<div>
				<input type="hidden" name="ma_id" id="ma_id" value="${ma_id}">
			    <input type="hidden"  id="addressId"> 
				<img src="${ctx }/image/dw.png" alt="" class="left"/>
				<p class="clearfix addressInfo">
					<span class="fl"></span>
					<span class="fr"></span>
				</p>
				<p class="oad"></p>
				<img src="${ctx }/image/dz.png" alt="" class="right" />
			</div>

		</section>
		<c:forEach var="shops" items="${shops}">
			<div class="orderDetail">
		         <input type="hidden" id="sellerId" value="${shops.sellerId}" />
				 <ul class="shoppingcart_goods goods obligation">
						<li>
							<div class="shoppingcart_store">
							<!-- 	<a href="store.html"> -->
								<a href="#">
									<img class="storeImg" src="${ctx }/image/dian.png" alt="" />
									<span>${shops.shopName }</span>
								</a>
								
							</div>
							
							<c:if test="${not empty shops.products  or fn:length(shops.products) >1 }">
							<c:forEach var="product" items="${shops.products}">
								<div class="shoppingcartDetail">
								
										<a class="sdImg"  id="${product.productId }" href="javascript:void(0)">
										<img src="${product.picture }" alt="${product.productName }" class="sis"/>
										<p class="sdWordA ">${product.productName }</p>										
										<c:set value="${product.goods_sku_info}" var="skuInfo"/>
										<p class="sdWordC" goods_sku_id="${product.goods_sku_id }">     								    
										<c:choose>
										    <c:when test="${skuInfo != null and skuInfo != '' and fn:length(fn:split(skuInfo,',')) > 0 }">	
									             <c:set value="${fn:split(skuInfo,',')}" var="skuInfoArr"/>
										             <c:forEach var="sku" items="${skuInfoArr }" varStatus="statuds">								             
											            <c:set value="${fn:split(sku,':')}" var="skuValues"/>										            
										              
											                <span>
											                    ${skuValues[0] }:
											                    <c:if test="${statuds.index == 0}">
											                        <i>${skuValues[1]}</i>
											                    </c:if> 
											                     <c:if test="${statuds.index >  0 }">
											                        <b>${skuValues[1]}</b>
											                    </c:if> 
											                </span>
										             </c:forEach>
										    </c:when>
										    <c:otherwise>
										         <span>无规格商品</span>
										    </c:otherwise>
										</c:choose>	
										  </p>
										<p class="sdWordP ">
										    <b>￥</b>
											<i class="unit_price">
												<c:choose>
												    <c:when test="${product.discountMarketPrice != null}">												    
												      	${product.discountMarketPrice}
												    </c:when>
												    <c:otherwise>
												        ${product.marketPrice}
												    </c:otherwise>
												</c:choose>	
											</i>
										</p>
										<span class="mWord">x${product.quantity}</span>
								        <c:if test="${not empty product.goodsProMapList  or fn:length(product.goodsProMapList) >1 }">									
									        <span class="activity">
									                 <span>促销活动:</span>
									                 <span class="same-select select-way" >
														<span class="content">不参与该活动</span>
														<span class="way-list">
										                     <span class="red">不参与该活动</span>	
															 <c:forEach var="goodsPro" items="${product.goodsProMapList }">		
																<span value="${goodsPro.proDetailId }"
																    goodsId="${goodsPro.productId }" 
																    proType="${goodsPro.proType }"  
																    mustQuantity = "${goodsPro.mustQuantity }"  
																    discountAmount = "${goodsPro.discountAmount }"
																    discountRate = "${goodsPro.discountRate }"
																    giftGoods ="${goodsPro.giftGoods }">
															      ${goodsPro.proDetailTitle }</span>
																
													        </c:forEach>								
														</span>						
													</span>
									        </span>
										</c:if>	
									</a>
									
								</div>								
							</c:forEach>
							</c:if>
						</li>
					</ul>
					<ul class="selectS">
						<%-- <c:set value="${shops.promotions}" var="shopPromotions"/>					
					    <c:set value="${promotions}" var="goodsPromotions"/>
						<c:if test="${fn:length(shopPromotions) > 1 or fn:length(goodsPromotions) >1 }">	
						    <li class="wholeOrderPromotion">
								<p class='clearfix'>
									<span class="selectLeft fl">店铺优惠</span>
									<span class="fr same-select select-way">			
										<span class="content">不参与该活动</span>
										<span class="way-list">	
										     <span class="red">不参与该活动</span>	
											 <c:if test="${ fn:length(shops.promotions) >1 }">												
											     <c:forEach var="shopPro" items="${shops.promotions }">	
													 <span value="${shopPro.proDetailId }" 
													         proType="${shopPro.proType }"
															 mustQuantity = "${shopPro.mustQuantity }"  
															 discountAmount = "${shopPro.discountAmount }"
															 discountRate = "${shopPro.discountRate }">
													 ${shopPro.proDetailTitle }</span>
												 </c:forEach>		
											 </c:if>	
										</span>								
									</span>
								</p>
							</li>
						 </c:if>--%>
						<li> 
							<p class='clearfix'>
								<span class="selectLeft fl">配送方式</span>
							    <span  class="freight">运费：<i class="expressFee">0.00</i>元</span>
								<span>快递：</span>
								<span class="fr same-select delivery" style="width: 25%;">			
									<span class="content"></span>
										<span class="way-list">
										</span>						
								</span>
						</p>
						</li>
						<li>
							<p class="clearfix">
								<span class="selectLeft fl">配送时间</span>
								<span class="fr">3-5天发货</span>
							</p>
						</li>
						<li>
							<p class="clearfix">
								<span class="selectLeft fl">买家备注：</span>
								<input class="fr memeo" type="text"  placeholder="选填：对本次交易的说明" />
							</p>
						</li>
						
					</ul>
					<div class="totalN">
						<span>共计<i>${shops.itemnum }</i>件</span>
			            <span>优惠<i class="promotion_money">0</i>元</span>
						<span>小计(含运费)： </span>
						<span class="price"><b>￥ </b><i class="total_price">${shops.totalAmount }</i></span>
					</div>
			</div>		
		</c:forEach>
        <div class="jiesuan orderJ clearfix">
			<span>共计<i>${totalItemnum }</i>件</span>
			<!-- <span>优惠<i id="promotion_totalAmount_money">0</i>元</span> -->
		    <span>合计：</span>
		    <span class="price"><b>￥ </b><i id="allTotalAmount">${totalAmount}</i></span>
		    <a href="javascript:void(0)" class="fr payment">
			  <p>提交订单</p>
		    </a>
       	</div>
		<script type="text/javascript" src="${ctx }/js/public.js"></script>
		<script type="text/javascript" src="${ctx }/js/order/address.js"></script>
		<script type="text/javascript" src="${ctx }/js/order/express.js"></script>
		<script type="text/javascript" src="${ctx }/js/order/order.js"></script>
	</body>

</html>
